# __coding:utf-8__
import scrapy;
from scrapy_work.items import FirstItem;


class Lagou(scrapy.Spider):
    name = 'sean'
    start_urls = [
        'https://www.lagou.com'
    ];

    def parse(self, response):
        for item in response.xpath('//div[@class="menu_box"]/div/dl/dd/a'):
            jobClass = item.xpath('text()').extract()
            jobUrl = item.xpath("@href").extract_first()

            oneItem = FirstItem()
            oneItem["jobClass"] = jobClass
            oneItem["jobUrl"] = jobUrl
            yield oneItem
